package com.example.javatwo.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class CreateNewId {

	/**
	 * 
	 * @param id
	 *            <==-当前表中最大的id
	 * @param name
	 *            <==-前缀
	 * @return
	 */
	private static String newID(String id, String name) {
		String a = new SimpleDateFormat("yyyyMMdd").format(new Date());
		if (id.substring(3, 11).equals(a)) {
			id = String.valueOf(Long.parseLong(id.substring(3, 14)) + 1);
		} else {
			id = a + "001";
		}
		return name + id;
	}

}
